#import "MMathLinkMark.h"
#import "MMathLink.h"
#import "mathlink.h"

@implementation MMathLinkMark

+ (id) markWithLink: (MMathLink*) link
{
	return [[[MMathLinkMark alloc] initWithLink: link] autorelease];
}

- (id) initWithLink: (MMathLink*) link
{
	self = [super init];
	_link = [link retain];
	_mark = MLCreateMark((MLINK) [_link link]);
	return self;
}

- (void) dealloc
{
	MLDestroyMark((MLINK) [_link link], (MLINKMark) _mark);
	[_link release];
	[super dealloc];
}

- (void) seek
{
	MLSeekMark((MLINK)[_link link], (MLINKMark)_mark, 0);
}

@end